package trd.tinysql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class HowToUse {

	/**
	 * @param args
	 * @throws ClassNotFoundException 
	 * @throws SQLException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		Class.forName("com.sqlmagic.tinysql.dbfFileDriver");
		Connection conn=DriverManager.getConnection("jdbc:tinysql:test/test", "", "");
		Statement st=conn.createStatement();
		//st.executeQuery("create table LONGTEST(shortcol char(12),longcolumnname7 char(27))");
//		for(int i=0;i<500;i++){
//			st.executeQuery("insert into longtest (shortcol,longcolumnname7) values ('hah','start with nothing');");
//		}
		ResultSet rs=st.executeQuery("select * from longtest");
		while(rs.next()){
			System.out.println(rs.getString("SHORTCOL"));
		}
	}

}
